<?php 

    if (version_compare(phpversion(), '5.2.0', '<') === true) {
        echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">It looks like you have an invalid PHP version.</h3></div><p>Supports PHP 5.2.0 or newer.</div>';
        exit(1);
    }

    require_once '../../serum/app/Main.php';
    
    $type = array('serum', 'project');
    
    umask(0);
    Main::_initialize('admin');
    /*if (!in_array($_GET['type'], $type)) {
    	$basePath = $_SERVER['REQUEST_URI'];
	    $basePath = explode('/', $basePath);
	    $basePath = array_slice($basePath, 0, -3);
	    $basePath = implode('/', $basePath);
	    $post['basePath'] = $basePath . '/';
	    
    	header('Location: '.$basePath);
    	exit();
    }
    $currentType    = ucfirst($_GET['type']);*/
    $updater        = Core_Updater::getInstance('Serum');
    
    $logged         = Core_Authentification::isConnected() ? 'true' : 'false';
    
    if ($logged == 'true') {
        $namespace = Core_Authentification::getNamespace();
        if (!in_array($namespace->login, $updater->getAuthorizedAccounts())) {
            $logged = 'false';
        }
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
            <link rel="shortcut icon" href="../../serum/skin/images/interface/favicon.ico" type="image/x-icon" />
            <link href="../../serum/skin/backend/css/style.css" type="text/css" rel="stylesheet" />
            <link href="../../serum/skin/backend/js/extjs/resources/css/ext-all.css" type="text/css" rel="stylesheet" />

            <script src="../../serum/skin/backend/js/extjs/adapter/ext/ext-base.js" type="text/javascript"></script>
            <script src="../../serum/skin/backend/js/extjs/ext-all-debug.js" type="text/javascript"></script>
            <script src="../../serum/skin/backend/js/extjs/build/locale/ext-lang-fr.js" type="text/javascript"></script>
            <script type="text/javascript">
            var logged = <?php echo $logged; ?>;
            </script>
            <script src="update.js" type="text/javascript"></script>
        <title>Serum - Updater</title>
    </head>

    <body class='x-border-layout-ct'>
    </body>
</html>
